package com.example.demo1.mytest;
class Animal {
    public void shout(){
        System.out.println("动物叫唤.....");
    }
}
class Chicken extends Animal{
    public void shout(){
        System.out.println("公鸡叫唤.....咕咕...");
    }
}
class Dog extends Animal{
    public void shout(){
        System.out.println("小狗叫唤.....汪汪...");
    }
}
class Polymorphic{
    public static void main(String[] args) {
        Animal dog=new Dog();
        dog.shout();
        Animal chicken=new Chicken();
        chicken.shout();
    }
}


